package netty.echo;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.util.CharsetUtil;

public class EchoSimpleChannelInboundHandler extends SimpleChannelInboundHandler<ByteBuf> {

    protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
        System.out.println("EchoSimpleChannelInboundHandler接收到消息：" + msg.toString(CharsetUtil.UTF_8));
        msg.resetReaderIndex();
    }
}
